package com.itheima.user.feign;

import com.itheima.order.pojo.Order;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@FeignClient(name = "order-service", fallback = OrderFallback.class)
public interface OrderFeign {

    /**
     * 根据用户名查询订单列表
     * @param username
     * @return
     */
    @GetMapping("/order/{username}")
    public List<Order> findOrdersByUserName(@PathVariable("username") String username);
}
